package com.ruoyi.system.controller.H5;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.system.domain.BaseBanner;
import com.ruoyi.system.domain.BaseContest;
import com.ruoyi.system.domain.dto.Web.BannerDto;
import com.ruoyi.system.service.IBaseBannerService;
import com.ruoyi.system.service.IBaseContestBindingService;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * h5 联赛绑定
 */
@ApiOperation("h5联赛绑定")
@RestController
@RequestMapping("/h5/contestBinding")
public class BaseContestBindingController extends BaseController
{
    @Autowired
    private IBaseContestBindingService iBaseContestBindingService;

    /**
     * 查询联赛绑定列表
     */
    @GetMapping("/list")
    @Operation(summary = "查询联赛绑定列表", description = "查询联赛绑定列表")
    public TableDataInfo list(BaseContest dto)
    {
        return iBaseContestBindingService.selectList(dto);
    }

    /**
     * 查询联赛绑定组合列表
     */
    @GetMapping("/getContestBindingGroupList")
    @Operation(summary = "查询联赛绑定组合列表", description = "查询联赛绑定组合列表")
    public AjaxResult getContestBindingGroupList(BaseContest dto)
    {
        return AjaxResult.success(iBaseContestBindingService.getContestBindingGroupList(dto));
    }

    /**
     * 根据联赛组合id查询 联赛列表
     */
    @GetMapping("/getContestListByBindingGroupId")
    @Operation(summary = "根据联赛组合id查询 联赛列表", description = "根据联赛组合id查询 联赛列表")
    public AjaxResult getContestListByBindingGroupId(@RequestParam("id") Long id)
    {
        return AjaxResult.success(iBaseContestBindingService.getContestListByBindingGroupId(id));
    }

    /**
     * 获取联赛分组总数据
     */
    @PostMapping("/contestAll")
    @Operation(summary = "获取联赛分组总数据", description = "获取联赛分组总数据")
    public AjaxResult contestAll(@RequestParam("groupId") Long groupId){
        return AjaxResult.success(iBaseContestBindingService.contestAll(groupId));
    }


}
